package com.jyk.blog.service.impl;

import com.jyk.blog.mapper.CommentMapper;
import com.jyk.blog.po.Comment;
import com.jyk.blog.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;

    @Override
    public List<Comment> queryByBlog(int id) {
        return commentMapper.findByBlog(id);
    }

    @Override
    public void insertOne(Comment comment) {
        commentMapper.insertOne(comment);
    }

    @Override
    public void deleteOne(int id) {
        commentMapper.deleteOne(id);
    }

    @Override
    public void deleteByBlog(int id) {
        commentMapper.deleteByBlog(id);
    }
}
